package com.suredy.app.area.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.suredy.app.area.model.Area;
import com.suredy.core.model.BaseModel;

@Entity
@Table(name = "T_DICT_AREA")
public class AreaEntity extends BaseModel{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3643723339469285911L;
	
	@Column(name = "Code")
	private String code; //识别码
	
	@Column(name = "Name")
	private String name; //名称
	
	@Column(name = "Longitude")
	private String longitude; //经度
	
	@Column(name = "Latitude")
	private String latitude; //纬度
	
	@Column(name = "Description")
	private String description; //描述

	
	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	
	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	
	/**
	 * @return the longitude
	 */
	public String getLongitude() {
		return longitude;
	}

	
	/**
	 * @param longitude the longitude to set
	 */
	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	
	/**
	 * @return the latitude
	 */
	public String getLatitude() {
		return latitude;
	}

	
	/**
	 * @param latitude the latitude to set
	 */
	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	
	@Transient
	public Area toVO(){
		Area vo = new Area();
		vo.setId(id);
		vo.setCode(code);
		vo.setDescription(description);
		vo.setLatitude(latitude);
		vo.setLongitude(longitude);
		vo.setName(name);
		
		return vo;
	}
}
